function addBlocks (Blockly) {
    const color = '#FF9966'; 

    Blockly.Blocks.servo_loongbian = {
        init: function () {
            this.jsonInit({
                message0: Blockly.Msg.SERVO_LOONGBIAN,//Blockly.Msg.SINGLELED_SET_LED_STATE
                args0: [
                    {
                        type: 'field_dropdown',// input gpoio
                        name: 'pin',
                        options: [
                            ['PWM0','PWM0'],
                            ['PWM1','PWM1'],
                            ['PWM2','PWM2'],
                            ['PWM3','PWM3']
                        ]
                    },
                    {
                        type: 'input_value',// input// xia la  menu
                        name: 'degree'
                    }
                ],
                colour: color,
                extensions: ['shape_statement'] // have diff output_number
                // block type
            });
        }
    };
    Blockly.Blocks.servo_loongbian_set_min = {
        init: function () {
            this.jsonInit({
                message0: Blockly.Msg.SERVO_LOONGBIAN_SET_MIN,//Blockly.Msg.SINGLELED_SET_LED_STATE
                args0: [
                    {
                        type: 'field_dropdown',// input gpoio
                        name: 'pin',
                        options: [
                            ['PWM0','PWM0'],
                            ['PWM1','PWM1'],
                            ['PWM2','PWM2'],
                            ['PWM3','PWM3']
                        ]
                    }
                ],
                colour: color,
                extensions: ['shape_statement']
            });
        }
    };
    Blockly.Blocks.servo_loongbian_set_max = {
        init: function () {
            this.jsonInit({
                message0: Blockly.Msg.SERVO_LOONGBIAN_SET_MAX,//Blockly.Msg.SINGLELED_SET_LED_STATE
                args0: [
                    {
                        type: 'field_dropdown',// input gpoio
                        name: 'pin',
                        options: [
                            ['PWM0','PWM0'],
                            ['PWM1','PWM1'],
                            ['PWM2','PWM2'],
                            ['PWM3','PWM3']
                        ]
                    }
                ],
                colour: color,
                extensions: ['shape_statement']
            });
        }
    };
    Blockly.Blocks.servo_loongbian_set_mid = {
        init: function () {
            this.jsonInit({
                message0: Blockly.Msg.SERVO_LOONGBIAN_SET_MID,//Blockly.Msg.SINGLELED_SET_LED_STATE
                args0: [
                    {
                        type: 'field_dropdown',// input gpoio
                        name: 'pin',
                        options: [
                            ['PWM0','PWM0'],
                            ['PWM1','PWM1'],
                            ['PWM2','PWM2'],
                            ['PWM3','PWM3']
                        ]
                    }
                ],
                colour: color,
                extensions: ['shape_statement']
            });
        }
    };
    return Blockly;
}

exports = addBlocks;
